package com.greate.community.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 登录凭证实体类
 * 用于记录用户登录状态和凭证信息
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LoginTicket {

    /**
     * 凭证ID
     */
    private int id;
    
    /**
     * 用户ID
     */
    private int userId;
    
    /**
     * 登录凭证
     */
    private String ticket;
    
    /**
     * 状态（0-有效; 1-无效）
     */
    private int status;
    
    /**
     * 过期时间
     */
    private Date expired;

    // Lombok @Data注解自动生成getter和setter方法

    @Override
    public String toString() {
        return "LoginTicket{" +
                "id=" + id +
                ", userId=" + userId +
                ", ticket='" + ticket + '\'' +
                ", status=" + status +
                ", expired=" + expired +
                '}';
    }
}
